* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
}

/* 顶部导航栏 */
.header {
    background: #333;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.logo {
    width: 120px;
    margin-right: 20px;
}

.logo img {
    width: 100%;
    height: auto;
}

/* 搜索框样式 */
.search-bar {
    flex: 1;
    display: flex;
    max-width: 500px;
    margin: 0 20px;
}

.search-bar input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    padding: 8px 20px;
    background: #ff6b00;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 用户操作区 */
.user-info {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.not-logged-in {
    display: flex;
    gap: 20px;
}

.not-logged-in a {
    color: white;
    text-decoration: none;
}

.logged-in {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    text-decoration: none;
}

.nav-link.highlight {
    color: #ff6b00;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 8px 0;
    min-width: 120px;
    margin-top: 8px;
}

.menu-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
}

.menu-dropdown a:hover {
    background: #f5f5f5;
}

.user-menu:hover .menu-dropdown {
    display: block;
}

/* 主要内容区 */
.main-container {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 0 20px;
}

/* 内容包装器 */
.content-wrapper {
    display: flex;
    gap: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    overflow: visible;
}

/* 左侧分类导航 */
.category-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #eee;
    height: 480px;
    overflow: visible;
}

/* 分类项样式 */
.category-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 13px;
}

.category-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.category-item:hover {
    background: #fff5dc;
}

.category-item:hover span {
    color: #ff6b00;
}

/* 添加连接区域，防止鼠标移动时失去hover状态 */
.category-item::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 0;
    width: 20px;
    height: 100%;
    background: transparent;
}

/* 确保详细分类面板在hover时保持显示 */
.category-detail::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    width: 20px;
    height: 100%;
    background: transparent;
}

.category-item img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.category-item span {
    flex: 1;
    font-size: 12px;
    color: #333;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item .arrow {
    margin-left: 8px;
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

/* 右侧内容区 */
.right-content {
    flex: 1;
    height: 480px;
    overflow: visible;
    position: relative;
    z-index: 50;
}

/* 广告布局 */
.banner-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    height: 180px;
}

/* 主要广告样式 */
.banner-main {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.banner-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.banner-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.banner-desc {
    font-size: 16px;
}

/* 小广告容器 */
.ad-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    height: 285px;
}

/* 小广告样式 */
.ad-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 12px;
    height: 135px;
    transition: transform 0.2s;
}

.ad-item:hover {
    transform: translateY(-3px);
}

.ad-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.ad-icon {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

.ad-info {
    flex: 1;
}

.ad-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

.ad-desc {
    font-size: 12px;
    color: #666;
}

.ad-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
    height: 60px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.ad-price {
    margin-top: 8px;
    color: #ff6b00;
    font-size: 14px;
    font-weight: bold;
}

/* 筛选标签区 */
.filter-section {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 15px;
}

.filter-tags {
    display: flex;
    gap: 10px;
}

.filter-tag {
    padding: 6px 15px;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.filter-tag.active {
    background: #ff6e30;
    color: white;
    border-color: #ff6e30;
}

/* 商品展示区 */
.product-section {
    padding: 20px;
    background: #f5f5f5;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 15px;
}

.product-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.product-img {
    width: 100%;
    height: 100%;
    object-position: center;
    object-fit: cover;
}

.view-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1;
}

.product-info {
    padding: 12px;
    text-align: left;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-info {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
}

.price {
    color: #ff1648;
    font-size: 16px;
    font-weight: bold;
}

.price::before {
    content: '¥';
    font-size: 12px;
    margin-right: 2px;
}

.original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 8px;
}

.original-price::before {
    content: '¥';
}

.seller-info {
    display: flex;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.seller-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

.seller-detail {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.seller-name {
    color: #666;
    font-size: 12px;
}

.seller-badge {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 2px;
    background: #fff1f0;
    color: #ff4d4f;
}

.no-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #999;
    font-size: 14px;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .product-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .category-sidebar {
        display: none;
    }
    
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 分类组样式 */
.category-group {
    position: relative;
    width: 100%;
    z-index: 100;
}

/* 详细分类面板 */
.category-detail {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 400px;
    background: #fff;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    padding: 15px;
    display: none;
    z-index: 1000;
    margin-left: 1px;
}

/* 分类组hover时显示详细分类 */
.category-group:hover {
    background-color: #f5f5f5;
    z-index: 1001;
}

.category-group:hover .category-detail {
    display: block;
}

/* 详细分类标题 */
.detail-section {
    margin-bottom: 15px;
}

.detail-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* 详细分类列表 */
.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-list a {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.detail-list a:hover {
    color: #ff6b00;
    background: #fff5dc;
}

/* 修改商品区域和筛选标签的样式 */
.filter-tags {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-tag {
    padding: 6px 20px;
    border-radius: 20px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-tag:hover {
    background: #f0f0f0;
}

.filter-tag.active {
    background: #ff6e30;
    color: white;
}

/* 猜你喜欢区域 */
.guess-you-like {
    margin-top: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
}

.section-title img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

/* 分类标签 */
.category-tags {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.category-tags::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.category-tag {
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    background: #f5f5f5;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-tag:hover {
    background: #f0f0f0;
}

.category-tag.active {
    background: #ffeb3b;
    color: #333;
    font-weight: bold;
}

.tag-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* 商品列表样式 */
.product-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.product-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.product-item:hover {
    transform: translateY(-3px);
}

.product-img {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    color: #ff4d4f;
    font-size: 16px;
    font-weight: bold;
}

.want-count {
    color: #999;
    font-size: 12px;
}

.seller-info {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.seller-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
}

.seller-level {
    color: #ff6e30;
    margin-left: auto;
}

.no-products {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* 右侧悬浮模块 */
.float-sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.float-item {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.float-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.float-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.float-item span {
    font-size: 12px;
    color: #666;
}

.float-item .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4f;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.back-to-top img {
    width: 24px;
    height: 24px;
}

.hover-info {
    position: absolute;
    z-index: 9999; /* 确保显示在最上层 */
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
}

/* 确保父容器使用相对定位 */
.product-container {
    position: relative;
}

/* 当鼠标悬停时显示信息 */
.product-container:hover .hover-info {
    display: block;
}

/* 分类导航样式 */
.category-sidebar {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 200px;
}

.category-group {
    position: relative;
    width: 100%;
}

.category-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f5f5f5;
}

.category-item span {
    flex: 1;
    margin: 0 10px;
}

.category-item img {
    width: 20px;
    height: 20px;
}

.category-item .arrow {
    color: #999;
}

.category-detail {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 500px;
    background: #fff;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    padding: 20px;
    display: none;
    z-index: 1000;
    border-radius: 4px;
    margin-left: 2px;
}

.category-group:hover {
    background-color: #f5f5f5;
}

.category-group:hover .category-detail {
    display: block;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-title {
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    font-size: 14px;
}

.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-list a {
    color: #666;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    background: #f5f5f5;
    font-size: 13px;
    transition: all 0.3s ease;
}

.detail-list a:hover {
    color: #ff6700;
    background: #fff0e6;
}

.content-wrapper {
    display: flex;
    gap: 20px;
    position: relative;
}

.right-content {
    flex: 1;
}